-
-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for "." in pathnames #132 #133
base: main
Are you sure you want to change the base?
Conversation
This is just allowing numbers with periods, specific to your use case |
I wouldn't say this is specific for my project since some packages (eg. express) seem to handle such routes aswell. const fs = require("fs")
const express = require("express")
const app = express()
app.use(express.static("public"))
app.get("*", (req, res) => {
const html = fs.readFileSync("public/index.html")
res.send(html.toString())
})
app.listen(3000) |
Right, I’m not saying the need is specific to you (should be done) but this fix is specifically only allowing paths with dot-separated numbers, which is your use case. |
I tested it on regexr and it should also allow paths with word characters aswell. |
It stops matching URLs like |
Updated the regex for better file name/extension matching |
@lukeed Toughts? |
#132